Repository navigation
fix: a dialog's input keeps the keyboard when focus is restored - #1089
Open
darkwebber wants to merge 1 commit into
Open
darkwebber wants to merge 1 commit into
darkwebber wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug: open a mod dialog whose mod focuses its own
Inputininit(as the shippedpromptdoes) from a key binding routed throughnextCommand(), then type right away. The first keys go to the terminal under the dialog. The shipped prompt hides this with a 600 ms re-focus timer.Cause:
restore_focusalways focuses the topmost dialog's frame handle. So any restore after the mod has focused its input (another overlay closing, the window regaining focus) takes the keyboard off the input.Fix: if the dialog's frame already contains the focused element, leave focus where it is.
Testing
cargo test --lockedpasses. The repro needs a mod rendered in a live window, so there's no unit test.🤖 Generated with Claude Code